#include "../src/graph/graph.h"
#include <stdio.h>
#include <stdlib.h>

void print_data(MVertex *v)
{
    printf("%s", (char *)v);
}

int main(int argc, char *argv[])
{
    MVertex const *v[] = {"A", "B", "C", "D", "E", "F"};
    MGraph *graph = MGraph_Create((MVertex **)v, 6);

    MGraph_AddEdge(graph, 0, 1, 1);
    MGraph_AddEdge(graph, 0, 2, 1);
    MGraph_AddEdge(graph, 0, 3, 1);
    MGraph_AddEdge(graph, 1, 5, 1);
    MGraph_AddEdge(graph, 1, 4, 1);
    MGraph_AddEdge(graph, 2, 1, 1);
    MGraph_AddEdge(graph, 3, 4, 1);
    MGraph_AddEdge(graph, 4, 2, 9);

    printf("weight <D, F> : %d\n", MGraph_GetEdge(graph, 3, 4));
    printf("Vertex Count: %d\n", MGraph_VertexCount(graph));
    printf("Edge Count : %d\n", MGraph_EdgeCount(graph));
    printf("Degree C : %d\n", MGraph_TD(graph, 2));

    MGraph_Display(graph, print_data);

    printf("\n\nmy Display start\n\n");
    MGraph_Display_matrix(graph);
    printf("\n\nmy Display end\n\n");

    MGraph_DFS(graph, 0, print_data);
    MGraph_BFS(graph, 0, print_data);

    MGraph_Destroy(graph);

    return 0;
}
